1. Field of the Invention
The present invention relates to a computer system that provides a data processing environment in which a program is executed as multiple threads. More particularly, the present invention relates to a system in which the threads share and access data that is stored in a memory device.
2. Description of the Related Art
In a data processing environment, a program may be executed as multiple threads, and the individual threads access shared data. In this type of processing environment, when a specific thread accesses specific data, a locking process is performed that inhibits the use of the data by other threads. Therefore, when a first thread needs to access data that is being employed by a second thread, the data is locked, and the first thread must wait for the data to be unlocked.
In this processing environment, data may also be present that is accessed only by a specific thread. However, even when the specific thread accesses such data, the locking process is conventionally performed relative to that data. That is, even when the probability is practically nil that other threads will seek to access the data in question, the locking process will still be performed, even though there is no need.
In addition, in such a processing environment, data that will no longer be accessed by any thread is retained in a storage area on a data storage device. Thus, the available storage area space may be considerably reduced. Therefore, as needed, to increase the available storage area space, garbage collection is performed to collectively remove data that are no longer necessary.
Conventional methods exists that are employed for garbage collection for programs executed as threads. One method temporarily halts the execution of a program while data that are no longer being accessed are searched for and removed from the storage area. Another method performs parallel processing during the execution of a program to determine which data are being accessed in order to select and remove data that are no longer necessary.
An example data processing environment is the operating environment for a program written in the Java language (hereinafter referred to as the Java operating environment). Java is a trademark of Sun Microsystems, Inc. In the Java language, when the threads of a program access objects that are created in a designated object pool in the storage area of a memory device, all the processes are performed. Therefore, in the Java operating environment, locking processes and garbage collection are frequently performed.
Thus, a demand exists for a high speed locking process and for a technique for reducing the required garbage collection time.
As is described above, in a data processing environment wherein multiple threads access shared data (objects), there are data that can be accessed only by one specific thread. Even when a thread accesses data for which the probability is practically nil that it will be accessed by other threads, an unnecessary locking process is performed, uselessly. As a result, the overall performance of the system is deteriorated.
According to one of the garbage collection methods, a program being executed as threads is temporarily halted to remove unnecessary data, and all the other processes of the system must be halted. In this case the usability for a user is very unsatisfactory.
According to another prior art technique, unnecessary data are removed while a program being executed as threads continues to run, and the data are searched for and removed during the operation. The result is that, for a user, the overall performance of the system is degraded.